{echo:JS::import('dialog?skin=brief');}
{echo:JS::import('dialogtools');}
{echo:JS::import('form');}
<form action="" method="post">
    <div class="tools_bar clearfix">
        <a class="icon-checkbox-checked icon-checkbox-unchecked" href="javascript:;" onclick="tools_select('id[]',this)"
           title="全选" data="true"> 全选 </a>
        <a class="icon-remove-2" href="javascript:;"
           onclick="tools_submit({action:'{url:/customer/withdraw_del}',msg:'删除后无法恢复，你真的删除吗？'})" title="删除"> 删除</a>
        <a class="icon-delicious" href="{url:/customer/withdraw_list}"> 全部记录</a>
        <!--<a style="color:red;" href="{url:/customer/download_widthdraw_execl_file}">导出提现记录</a>-->
        <span class="fr"><a href='javascript:;' id="condition" class="icon-search" style=""> 筛选条件</a><input
                id="condition_input" type="hidden" name="condition" value="{$condition}"></span>
    </div>
    提现总金额:<b style="color:red;"> {$total_1}</b> &nbsp;&nbsp; 待处理总金额：<b style="color:red;"> {$total_2}</b>&nbsp;&nbsp;
    已同意总金额:<b style="color:red;"> {$total_3}</b> &nbsp;&nbsp;已拒绝总金额:<b style="color:red;"> {$total_4}</b>
    <table class="default">
        <tr>
            <th style="width:40px">选择</th>
            <th style="width:70px">操作</th>
            <th style="width:80px">用户</th>
            <th style="width:80px">申请金额</th>
            <th style="width:80px">手续费</th>
            <th style="width:80px">实发金额</th>
            <th style="width:100px">姓名</th>
            <th>金融机构</th>
            <th>金融账号</th>
            <th>申请时间</th>
            <th style="width:60px">状态</th>
        </tr>
        {query:name=withdraw as wd fields=wd.*,us.name as uname join= left join user as us on wd.user_id eq us.id key=$i
        where= $where id=$obj page=1 desc pagesize=20}
        <tr>
            <td>
                {echo:$i+1}
                <input type="checkbox" name="id[]" value="{$item['id']}">

            </td>
            <td style="width:70px" class="btn_min">
                <div class="operat hidden"><a class="icon-cog action" href="javascript:;"> 处理</a>
                    <div class="menu_select">
                        <ul>
                            {if:$item['status']==0}
                            <li><a class="icon-pencil" href="javascript:withdrawAction({$item['id']});"> 审批</a></li>
                            {/if}
                            <!--
                            <li> <a class="icon-remove-2" href="javascript:confirm_action('{url:/customer/withdraw_del/id/$item[id]}')"> 删除</a></li>
                            -->
                        </ul>
                    </div>
                </div>
            </td>
            <td>{$item['uname']}</td>
            <td>{$item['sq_money']}</td>
            <td>{$item['txf']}</td>
            <td class="red">{$item['amount']}</td>
            <td>{$item['name']}</td>
            <td>{$item['type_name']}</td>
            <td>{$item['account']}</td>
            <td>{$item['time']}</td>
            <td>{echo:$item['status']==0?"<span class='red'>等待处理</span>":($item['status']==1?"<b class='green'>同意</b>":"<span
                    class='gray'>拒绝</span>");}
            </td>
        </tr>
        {/query}
    </table>
</form>
<div class="page_nav">
    {echo:$obj->pageBar()}
</div>
<script type="text/javascript">
    var form = new Form();
    $("#condition").on("click", function () {
        $("body").Condition({
            input: "#condition_input", okVal: '高级搜索', callback: function (data) {
                tools_submit({action: '{url:/customer/withdraw_list}', method: 'get'});
            }, data: {
                'us.name': {name: '用户名'},
//                'wd.name': {name: '账户名'},
//                'type_name': {name: '名称'},
                account: {name: '金融账号'},
//                'wd.amount': {name: '申请金额'},
                'wd.status': {name: '状态', values: {1: '同意',2:'拒绝'}}
            }
        });
    });
    function withdrawAction(id) {
        art.dialog.open("{url:/customer/withdraw_view/id/}" + id, {id: 'withdraw-dialog', title: "审批", width: 620});
    }
    function close_dialog() {
        art.dialog({id: "withdraw-dialog"}).close();
        tools_reload();
    }
</script>
